UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qo4ryCC1gS5AFF7LxrwRboAzav3jr4OVTwcKq4FQxoc=' 
WHERE 
  key_id = 'd45e09e5018632f5c125128c1c755489ec00424fa05a00ff91d6156aa6af8486' 
  AND (
    token = 'Qo4ryCC1gS5AFF7LxrwRboAzav3jr4OVTwcKq4FQxoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045