UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mOl4SZm4EI4SX/Yqak4Ex68rGZzrz2BxzjYGIs2vRCA='
WHERE
key_id = 'bbce77bc94eccbd361ef4bce089bbd6b88727128d36f427cc833d0e828d16403'
AND (
token = 'mOl4SZm4EI4SX/Yqak4Ex68rGZzrz2BxzjYGIs2vRCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)