UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wKe1Lbn5xaxu4UgTuF/EXsbXn6EwpL9qFk52hEHpp9Q='
WHERE
key_id = 'ddfc72f995576d3cb240f9e4820a6270de9940f891f240dc52838b7ab8b52ec0'
AND (
token = 'wKe1Lbn5xaxu4UgTuF/EXsbXn6EwpL9qFk52hEHpp9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)