UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4FEC9i4O94Rujr4VT6dDotqpCjTJJMlsEgR7idurY8o=' 
WHERE 
  key_id = 'da1a69ba8cd482767a15d02b22731e2d3c787926262bed6dc5e03ff4c664584d' 
  AND (
    token = '4FEC9i4O94Rujr4VT6dDotqpCjTJJMlsEgR7idurY8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029