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

Query time 0.00023