UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7/1PiMHz5JK9dWqyrDclmgSRxmIgc0pYxMxuoieaxXw=' 
WHERE 
  key_id = '762e041889fcf5befde0f7fd56a21ae91c1072d1af9d9d57a09e1eda02b15083' 
  AND (
    token = '7/1PiMHz5JK9dWqyrDclmgSRxmIgc0pYxMxuoieaxXw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016