UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c+hMpzh4eSv0LymziET1GyuovGgoeJeWobWn5+/SfvQ='
WHERE
key_id = '435de33498f496894bd509c23282b07108648d61e14f86bc6c27cb2d677b94c0'
AND (
token = 'c+hMpzh4eSv0LymziET1GyuovGgoeJeWobWn5+/SfvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)