UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '28cTyucV95yvny7rJnIendcFm+/Tc+1mH9fVPFIOR3g=' 
WHERE 
  key_id = 'b68115470dd87e6a5042cf97c0ad026d3ebb3137f00080a1da2a3f47a0a12c9e' 
  AND (
    token = '28cTyucV95yvny7rJnIendcFm+/Tc+1mH9fVPFIOR3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037