UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cHkLnl+L8DXpmpjHqVnP1XTZwahF/NVHJVDRM/PpCc0='
WHERE
key_id = 'a7224907a406d2cb4adca6e27b71de6d61b3bf1997e2a528f476f3ce75a07372'
AND (
token = 'cHkLnl+L8DXpmpjHqVnP1XTZwahF/NVHJVDRM/PpCc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)