UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vEK0xJ0UNV5UCZHN8XnLdJANYeZfc8vqhylKlV1T/3I='
WHERE
key_id = 'efb0e09de91558579b4917d128052e4d1bf9ec1246914530bdb1d2d624903a49'
AND (
token = 'vEK0xJ0UNV5UCZHN8XnLdJANYeZfc8vqhylKlV1T/3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)