UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OEzjFF3ZXuz1MYQ8p2EBn/U1o2e9tOuGBtqCiZ/+C/8='
WHERE
key_id = '0ce7726231913397e2d4a870ef13d2fd9a6fc1c7eddf321ee83f2c7dbe5f7d3c'
AND (
token = 'OEzjFF3ZXuz1MYQ8p2EBn/U1o2e9tOuGBtqCiZ/+C/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)