UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VmOE9gxvWe/30QIWr5Qh6ocZTyiMderRQW0MAPVE3CI='
WHERE
key_id = '7c0f3f322454aab2ab2ba621e8625bbd9f4af1839b5cd5f9edc3752dacbc6581'
AND (
token = 'VmOE9gxvWe/30QIWr5Qh6ocZTyiMderRQW0MAPVE3CI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)