UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q7CIRxrsXMMm5er7Oa0Z+lCq37qQRax22SYv5GhKhCk=' 
WHERE 
  key_id = '388236529c4e03df963b9fb4a7cfd9e2f80dcbd2d97d5088e8bc116e922ede52' 
  AND (
    token = 'Q7CIRxrsXMMm5er7Oa0Z+lCq37qQRax22SYv5GhKhCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017