UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TLfp7dmdTKcKcz5C17p1qmZKthfc/ZayTTS0IcV1jfg='
WHERE
key_id = '2182cddd4b494618eff30446fca3f6f2ec51475267a1ced9bea2a4085d5afce2'
AND (
token = 'TLfp7dmdTKcKcz5C17p1qmZKthfc/ZayTTS0IcV1jfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)