UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WlHQmTGxMg4maEswguniArCRe/VVs4XZecxiOLOZDr0='
WHERE
key_id = '94234a167d371790c3bc5741069bf5c597bb7a0c8bc4777ccb5d3f7793677014'
AND (
token = 'WlHQmTGxMg4maEswguniArCRe/VVs4XZecxiOLOZDr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)