UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0fgWkHr7do2tQe7qgqqxWj1hx7oCk6hDYUoBo/nd/Ro='
WHERE
key_id = '2c5a3da96140efb77e3d66f3a6f755034f0201ede4a8eb8e57587155525f9f0a'
AND (
token = '0fgWkHr7do2tQe7qgqqxWj1hx7oCk6hDYUoBo/nd/Ro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)