UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HM0m7V1yt4Wv57oOnITgbOrXeE7po/pYT2vL5e5gc+g=' 
WHERE 
  key_id = '4294ed4ba1cae30d8c63da1176596ec0199e2ca59645189c25ddb8391d78ca4f' 
  AND (
    token = 'HM0m7V1yt4Wv57oOnITgbOrXeE7po/pYT2vL5e5gc+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031