UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iDwae0UkdLe6MHxmXlubUSckDvGkRD7aX7uJndGjJXI='
WHERE
key_id = '95fd313286b8d1cadcb2632777501ac07f945f953358ee0fd74b2b5ae82e5782'
AND (
token = 'iDwae0UkdLe6MHxmXlubUSckDvGkRD7aX7uJndGjJXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)