UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UAdYXaUo9HkfHALxH3sRrcK38fU0jLqILURXQXvgnek=' 
WHERE 
  key_id = '7be4b41a78a9ff27d064bc15072c81c703a2f94d3b987eaba95e343672aec1ba' 
  AND (
    token = 'UAdYXaUo9HkfHALxH3sRrcK38fU0jLqILURXQXvgnek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043