UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VPJ9aICD23lRhhme1ObOBSh3iHjRoaJPbxtwpA74TLY='
WHERE
key_id = 'f3e7969aaf400a1786a0cbec35d005f4b0cd3e893f25234b241ec300ce7cc0bc'
AND (
token = 'VPJ9aICD23lRhhme1ObOBSh3iHjRoaJPbxtwpA74TLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)