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

Query time 0.00038