UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8tjFs4GtnyrHQmj8tsUZv4jnXug18PobI4iWF07voAs=' 
WHERE 
  key_id = '792dc0127d7d3909db6b3d159e5e8b840213c8c57f80e8189737e636642cd866' 
  AND (
    token = '8tjFs4GtnyrHQmj8tsUZv4jnXug18PobI4iWF07voAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071