UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dfo1vtNGhDt/OyTTNPoGrJho6ES4XOnXmNokKKMctDI='
WHERE
key_id = '0d104ad8f002497cc87116a4d71a0150913b7aacd4abff62482a8b24866bca04'
AND (
token = 'dfo1vtNGhDt/OyTTNPoGrJho6ES4XOnXmNokKKMctDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)