UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OAGZcK0Oni/F+eY0DLvSmZzxYERxV2wLPPK0F5kRZVs='
WHERE
key_id = '09f7d2fdfd57582b1f542da3850f8119e0fd0593fc3b261c93fc49faa07c0de2'
AND (
token = 'OAGZcK0Oni/F+eY0DLvSmZzxYERxV2wLPPK0F5kRZVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)