UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jgoix6u+/9t4rMiqvcwV0u6bz0LmPtsEbGAYPTnEN4o='
WHERE
key_id = '8f22639d2a1eb3fb48bdec2ba410288173d09d1438850c0cb2ccc60645b087a5'
AND (
token = 'Jgoix6u+/9t4rMiqvcwV0u6bz0LmPtsEbGAYPTnEN4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)