UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+lzWBoWWFGTl1Dep9/WW7F6sefTFX+oN9zcogTo4GzQ=' 
WHERE 
  key_id = '07b66a7b10e163ee7943347ca529312614c0ec399d041c5b822dcf1f9ba1f52b' 
  AND (
    token = '+lzWBoWWFGTl1Dep9/WW7F6sefTFX+oN9zcogTo4GzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035