UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aqelNB/EPKMSUmNwWUBFG3cH5yjvJhh79qXi+FU0EVY='
WHERE
key_id = '3eb35408502e13d5726d17534f7cafcfbbb286ff53edfeef2df995ba9d451b8d'
AND (
token = 'aqelNB/EPKMSUmNwWUBFG3cH5yjvJhh79qXi+FU0EVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)