UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WRSY2HEHAoFSKDELFNqQBUSuhLK/OSeMLjDyZx5rEog=' 
WHERE 
  key_id = '8eb0adb82dbb30bc5719ef746c35d85f07fed46b0f7910925c7f5c1c1146a33d' 
  AND (
    token = 'WRSY2HEHAoFSKDELFNqQBUSuhLK/OSeMLjDyZx5rEog=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040