UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dqLVEJeHczWL0g9wGyHO10s2XQetxzrpZRe1dY2nMg4='
WHERE
key_id = '6418e714a076b471a8089e17daf44b7927e38ea1992d7a1a7224e496087659c3'
AND (
token = 'dqLVEJeHczWL0g9wGyHO10s2XQetxzrpZRe1dY2nMg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)