UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LvfZx5vEdGkZGfPbU9dBSPwjurk55r9XA5m5P4FYl1I='
WHERE
key_id = '13fd558ae23bcbcb8cc9b4493eedac2ac7fd670aad06173a59cbdb55d6a80b1e'
AND (
token = 'LvfZx5vEdGkZGfPbU9dBSPwjurk55r9XA5m5P4FYl1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)