UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AbInQkpo8I5mIolHdPYMH4kSRYe/iam5LXKkA6rb6E8=' 
WHERE 
  key_id = 'e31867aecfe1b67005f848cb71d98fbd42441f822792b5ebf0c4cc4d7cc1b3b2' 
  AND (
    token = 'AbInQkpo8I5mIolHdPYMH4kSRYe/iam5LXKkA6rb6E8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037