UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I3yfnrBsxMIUyFExvjiFmxu9qiQWYBQw+k7KGWmJ5CA=' 
WHERE 
  key_id = '7675b40024a5a840250b64d82f972a7ce77e54dcd40d6dffeb56b4982740291c' 
  AND (
    token = 'I3yfnrBsxMIUyFExvjiFmxu9qiQWYBQw+k7KGWmJ5CA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041