UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6GIBOhm7VTLAnzpmKQsV358TRdsPrYcRbaNqicT+iFc=' 
WHERE 
  key_id = '4fd822e47df088e318b5e92731c09b17806ebc98a3aa72feb54c3359b90fcf6b' 
  AND (
    token = '6GIBOhm7VTLAnzpmKQsV358TRdsPrYcRbaNqicT+iFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037