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

Query time 0.00020